package com.example.picturestorage.service;

import com.example.picturestorage.bean.Role;
import com.example.picturestorage.mapper.RoleMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class RoleServiceImpl implements RoleService{

    @Autowired
    private RoleMapper roleMapper;

    @Override
    public Role findOneRole(Integer id) {
        Role role = roleMapper.selectOneRole(id);
        Role role1 = roleMapper.selectOneRole(id);
        System.out.println("role==role1 "+(role==role1));
        return roleMapper.selectOneRole(id);
    }

    @Override
    public List<Role> findRoleList() {
        return roleMapper.selectRoleList();
    }

    @Override
    public List<Role> selectRoleByCondition(Role role) {
        return roleMapper.selectRoleByCondition(role);
    }

    @Override
    public int updateOneByCondition(Role role) {
        return roleMapper.updateOneByCondition(role);
    }
}
